<?php
    class Default_Model_Block extends Zend_Db_Table_Abstract
    {
        protected $_db;

        public function __construct()
        {
            $this->_db = Zend_Registry::get('db');
        }

        public function getBlock($block, $locale)
        {
            $sql = $this->_db->select()
                ->from('block AS b', null)
                ->join('block_language AS bl', 'bl.block_id = b.id', array('description'))
                ->join('language AS l', 'l.id = bl.language_id', null)
                ->where('b.block = ?', $block)
                ->where('l.locale = ?', $locale);
            $result = $this->_db->fetchOne($sql);
            return $result;
        }
    }
